reftests: Add test for pseudo-class matching
authorBenjamin Otte <otte@redhat.com>
Wed, 28 Dec 2011 22:16:51 +0000 (23:16 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 9 Jan 2012 17:37:50 +0000 (18:37 +0100)
Previous GTK matched pseudoclasses not based on CSS rules, but based on
their value in the enumeration. This is now fixed.

tests/reftests/Makefile.am
tests/reftests/css-multi-state.css [new file with mode: 0644]
tests/reftests/css-multi-state.ref.ui [new file with mode: 0644]
tests/reftests/css-multi-state.ui [new file with mode: 0644]

index 9f5efc61ddd7892c32f20a6f4f34fa04f386631a..1175e243252492d6de23827d84ccbcc0711e6cd0 100644 (file)
@@ -103,6 +103,9 @@ EXTRA_DIST += \
        css-match-type.css \
        css-match-type.ref.ui \
        css-match-type.ui \
+       css-multi-state.css \
+       css-multi-state.ref.ui \
+       css-multi-state.ui \
        entry-progress-coloring.css \
        entry-progress-coloring.ref.ui \
        entry-progress-coloring.ui \
diff --git a/tests/reftests/css-multi-state.css b/tests/reftests/css-multi-state.css
new file mode 100644 (file)
index 0000000..b3b96fc
--- /dev/null
@@ -0,0 +1,9 @@
+GtkLabel:active,
+#reference:insensitive {
+  color: green;
+}
+
+GtkLabel:insensitive,
+#reference:active {
+  color: blue;
+}
diff --git a/tests/reftests/css-multi-state.ref.ui b/tests/reftests/css-multi-state.ref.ui
new file mode 100644 (file)
index 0000000..f7f31a4
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkToggleButton" id="togglebutton1">
+        <property name="use_action_appearance">False</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="use_action_appearance">False</property>
+        <property name="active">True</property>
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="name">reference</property>
+            <property name="visible">True</property>
+            <property name="sensitive">False</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">insensitive</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/tests/reftests/css-multi-state.ui b/tests/reftests/css-multi-state.ui
new file mode 100644 (file)
index 0000000..b97d395
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkToggleButton" id="togglebutton1">
+        <property name="use_action_appearance">False</property>
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="receives_default">True</property>
+        <property name="use_action_appearance">False</property>
+        <property name="active">True</property>
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="sensitive">False</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">insensitive</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>